<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->


<!DOCTYPE html
  PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
   
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="DC.Type" content="topic">
<meta name="DC.Title" content="Restoring MySQL/MariaDB/GreatSQL Databases">
<meta name="product" content="">
<meta name="DC.Relation" scheme="URI" content="mysql-0049.html">
<meta name="prodname" content="">
<meta name="version" content="">
<meta name="brand" content="30-OceanProtect Appliance 1.5.0-1.6.0 Help Center">
<meta name="DC.Publisher" content="20241029">
<meta name="documenttype" content="usermanual">
<meta name="prodname" content="csbs">
<meta name="DC.Format" content="XHTML">
<meta name="DC.Identifier" content="mysql-0052">
<meta name="DC.Language" content="en-us">
<link rel="stylesheet" type="text/css" href="public_sys-resources/commonltr.css">
<title>Restoring MySQL/MariaDB/GreatSQL Databases</title>
</head>
<body style="clear:both; padding-left:10px; padding-top:5px; padding-right:5px; padding-bottom:5px"><a name="mysql-0052"></a><a name="mysql-0052"></a>

<h1 class="topictitle1">Restoring MySQL/MariaDB/GreatSQL Databases</h1>
<div><p>This section describes how to use a copy to restore a database that has been backed up to the original or a new location.</p>
<div class="section"><h4 class="sectiontitle">Prerequisites</h4><ul><li>Before performing a restoration job, ensure that the database in the target location has been shut down.</li><li>Before restoration, ensure that the remaining space of the data directory at the target location for restoration is greater than the size of the copy used for restoration before reduction. Otherwise, restoration will fail.</li><li>Before performing a restoration job, ensure that the soft links of <strong>mysqlbinlog</strong>, <strong>mysqldump</strong>, <strong>mysqld</strong>, <strong>mysqladmin</strong>, and <strong>mysql</strong> are correctly configured. For details, see <a href="mysql-0016.html">Step 2: Manually Configuring Soft Links</a>.</li></ul>
</div>
<div class="section"><h4 class="sectiontitle">Procedure</h4><ol><li><span>Choose <span class="uicontrol" id="mysql-0052__en-us_topic_0000001839142377_uicontrol734315167278"><b><span id="mysql-0052__en-us_topic_0000001839142377_text133437163275"><strong>Explore</strong></span> &gt; <span id="mysql-0052__en-us_topic_0000001839142377_text143431916102710"><strong>Copy Data</strong></span> &gt; <span id="mysql-0052__en-us_topic_0000001839142377_text159620466494"><strong>Databases</strong></span> &gt; <span id="mysql-0052__en-us_topic_0000001839142377_text69125533114"><strong>MySQL/MariaDB</strong></span>/GreatSQL</b></span>.</span></li><li><span>Search for copies by MySQL/MariaDB/GreatSQL resource or copy. This section describes how to search for copies by resource.</span><p><p>On the <span class="uicontrol"><b><span><strong>Resources</strong></span></b></span> tab page, find the resource to be restored by resource name and click the resource name.</p>
</p></li><li><span>Select the year, month, and day in sequence to find the copy.</span><p><p>If <span><img src="en-us_image_0000001839222661.png"></span> is displayed below a month or date, copies exist in the month or on the day.</p>
</p></li><li><span>In the row of the target copy, choose <span class="uicontrol"><b><span><strong>More</strong></span> &gt; <span><strong>Restore</strong></span></b></span>.</span><p><p><a href="#mysql-0052__en-us_topic_0000001263614142_table93951625101715">Table 1</a> describes the related parameters.</p>

<div class="tablenoborder"><a name="mysql-0052__en-us_topic_0000001263614142_table93951625101715"></a><a name="en-us_topic_0000001263614142_table93951625101715"></a><table cellpadding="4" cellspacing="0" summary="" id="mysql-0052__en-us_topic_0000001263614142_table93951625101715" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameters for restoring a MySQL/MariaDB/GreatSQL database</caption><colgroup><col style="width:32.53%"><col style="width:67.47%"></colgroup><thead align="left"><tr><th align="left" class="cellrowborder" valign="top" width="32.53%" id="mcps1.3.3.2.4.2.2.2.3.1.1"><p>Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="67.47%" id="mcps1.3.3.2.4.2.2.2.3.1.2"><p>Description</p>
</th>
</tr>
</thead>
<tbody><tr><td class="cellrowborder" valign="top" width="32.53%" headers="mcps1.3.3.2.4.2.2.2.3.1.1 "><p><span><strong>Restore To</strong></span></p>
</td>
<td class="cellrowborder" valign="top" width="67.47%" headers="mcps1.3.3.2.4.2.2.2.3.1.2 "><p>Select either <span class="uicontrol"><b><span><strong>Original location</strong></span></b></span> or <span class="uicontrol"><b><span><strong>New location</strong></span></b></span>.</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="32.53%" headers="mcps1.3.3.2.4.2.2.2.3.1.1 "><p><span><strong>Location</strong></span></p>
</td>
<td class="cellrowborder" valign="top" width="67.47%" headers="mcps1.3.3.2.4.2.2.2.3.1.2 "><p>If you select <span class="uicontrol"><b><span><strong>Original location</strong></span></b></span>, the target location is displayed by default.</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="32.53%" headers="mcps1.3.3.2.4.2.2.2.3.1.1 "><p><span><strong>Target Instance</strong></span></p>
</td>
<td class="cellrowborder" valign="top" width="67.47%" headers="mcps1.3.3.2.4.2.2.2.3.1.2 "><p>If you select restoration to <span><strong>New location</strong></span>, select the target instance for restoration.</p>
<div class="note"><span class="notetitle"> NOTE: </span><div class="notebody"><p>This parameter is displayed when <strong>Type</strong> is <strong>Single instance</strong> or <strong>Cluster instance</strong>.</p>
</div></div>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="32.53%" headers="mcps1.3.3.2.4.2.2.2.3.1.1 "><p><span><strong>Target Database</strong></span></p>
</td>
<td class="cellrowborder" valign="top" width="67.47%" headers="mcps1.3.3.2.4.2.2.2.3.1.2 "><p>If you select restoration to <span><strong>New location</strong></span>, select the target database for restoration.</p>
<div class="note"><span class="notetitle"> NOTE: </span><div class="notebody"><p>This parameter is displayed when <strong>Type</strong> is <strong>Databases</strong>.</p>
</div></div>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="32.53%" headers="mcps1.3.3.2.4.2.2.2.3.1.1 "><p><span><strong>Rename Database</strong></span></p>
</td>
<td class="cellrowborder" valign="top" width="67.47%" headers="mcps1.3.3.2.4.2.2.2.3.1.2 "><p>The restored database can be renamed.</p>
<div class="note"><span class="notetitle"> NOTE: </span><div class="notebody"><ul><li>This parameter is displayed when <strong>Type</strong> is <strong>Databases</strong>.</li><li>The copy to be live mounted must be in the <span class="uicontrol"><b><span><strong>Normal</strong></span></b></span> state.</li></ul>
</div></div>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="32.53%" headers="mcps1.3.3.2.4.2.2.2.3.1.1 "><p><span><strong>Forcible Restoration</strong></span></p>
</td>
<td class="cellrowborder" valign="top" width="67.47%" headers="mcps1.3.3.2.4.2.2.2.3.1.2 "><p>This function is disabled by default. After this function is enabled, data can be forcibly restored when the database page is damaged.</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="32.53%" headers="mcps1.3.3.2.4.2.2.2.3.1.1 "><p><span><strong>Script to Run Before Restoration</strong></span></p>
</td>
<td class="cellrowborder" rowspan="3" valign="top" width="67.47%" headers="mcps1.3.3.2.4.2.2.2.3.1.2 "><p>You can execute a custom script as required before a restoration job is executed or after it succeeds or fails.</p>
<p>Enter a script name that ends with <strong>.sh</strong>. Ensure that the script has been stored in the <span class="filepath"><b>DataBackup/ProtectClient/ProtectClient-E/sbin/thirdparty</b></span> directory in the ProtectAgent installation directory and the user (user <strong>root</strong> by default) who has logged in to the database host is permitted to execute the script.</p>
<div class="note"><span class="notetitle"> NOTE: </span><div class="notebody"><p>If <strong>Script to Run upon Restoration Success</strong> is configured, the status of the restoration job is displayed as <strong>Successful</strong> on the <span>OceanProtect</span> even if the script fails to be executed. Check whether the job details contain information indicating that a post-processing script fails to be executed. If yes, modify the script in a timely manner.</p>
</div></div>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" headers="mcps1.3.3.2.4.2.2.2.3.1.1 "><p><span><strong>Script to Run upon Restoration Success</strong></span></p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" headers="mcps1.3.3.2.4.2.2.2.3.1.1 "><p><span><strong>Script to Run upon Restoration Failure</strong></span></p>
</td>
</tr>
</tbody>
</table>
</div>
</p></li><li><span>Click <span class="uicontrol"><b><span><strong>OK</strong></span></b></span>.</span><p><div class="note"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p>After the restoration is complete, wait for several minutes until data synchronization between nodes is complete.</p>
</div></div>
</p></li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="mysql-0049.html">Restoration</a></div>
</div>
</div>

<div class="hrcopyright"><hr size="2"></div><div class="hwcopyright">Copyright &copy; Huawei Technologies Co., Ltd.</div></body>
</html>